package com.nuanshui.heatedloan.entity.cms.security;


import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.google.common.collect.Lists;
import com.nuanshui.heatedloan.entity.IdEntity;
import com.nuanshui.heatedloan.extension.jpasearch.SearchType;

/**
 * 用户表
 */
@Entity
@Table(name = "cms_security_user")
public class UserVO extends IdEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 真实姓名
	 */
	@SearchType
	private String realname;

	/**
	 * 登陆用户名
	 */
	@SearchType
	private String username;

	/**
	 * 密码
	 */
	private String password;

	@Transient
	private String plainPassword;

	private String salt;

	/**
	 * 电话
	 */
	@SearchType
	private String phone;

	/**
	 * E-mail
	 */
	@SearchType
	private String email;

	/**
	 * 使用状态disabled，enabled
	 */
	@SearchType
	private String status = "enabled";

	/**
	 * 用户头像
	 */
	private String photo;
	
	private Integer defaultUser;//是否是默认用户 如超级管理员，是不允许删除的
	
	private String museumId;//管理的展馆id

	@Transient
	private List<UserRoleVO> userRoles = Lists.newArrayList();

	
	private Date createTime;
	
	private String nick;

	public String getNick() {
		return nick;
	}

	public void setNick(String nick) {
		this.nick = nick;
	}

	public String getMuseumId() {
		return museumId;
	}

	public void setMuseumId(String museumId) {
		this.museumId = museumId;
	}

	public Integer getDefaultUser() {
		return defaultUser;
	}

	public void setDefaultUser(Integer defaultUser) {
		this.defaultUser = defaultUser;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(final String realname) {
		this.realname = realname;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(final String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(final String password) {
		this.password = password;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(final String status) {
		this.status = status;
	}

	public String getPlainPassword() {
		return plainPassword;
	}

	public void setPlainPassword(final String plainPassword) {
		this.plainPassword = plainPassword;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(final String salt) {
		this.salt = salt;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(final String email) {
		this.email = email;
	}
	
	public List<UserRoleVO> getUserRoles() {
		return userRoles;
	}
	
	public void setUserRoles(final List<UserRoleVO> userRoles) {
		this.userRoles = userRoles;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(final String phone) {
		this.phone = phone;
	}


	public String getPhoto() {
		return photo;
	}

	public void setPhoto(final String photo) {
		this.photo = photo;
	}
	
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(final Date createTime) {
		this.createTime = createTime;
	}

/*	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}*/
}
